<!DOCTYPE html>
<html>
<head>
    {include file="../application/common/header.html" /}
</head>

<body>
    <div id="subject_teachertb">
        <form id="subject_teacherForm" class="m5">
            年级：
            <select class="form-control1" name="grade" id="grade"></select>
            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="searchForm('subject_teacher')">查询</a>
            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-clear'" onclick="resetForm('subject_teacher')">重置</a>
            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-tip'" onclick="downloadTemplate('科任教师模板.xls')">下载EXCEL模板</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-large-smartart',plain:true" onclick="importExcel('subject_teacher')">导入</a><br/>
        </form>
    </div>
    <table id="subject_teacherdg">
        <thead>
            <tr>
                <th data-options="field:'ID',checkbox:true">ID</th>
                <th data-options="field:'年级号',title:'年级',width:20,formatter:function(value,row,index){
                    return row.gradeName;
                }"></th>
                <th data-options="field:'班号',title:'班号',width:20"></th>
                <th data-options="field:'班主任ID',title:'班主任',width:20,formatter:function(value,row,index){
                    return row.班主任;
                }"></th>
                <th data-options="field:'语文',title:'语文',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html',
                        required:true
                    }
                }"></th>
                <th data-options="field:'数学',title:'数学',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html',
                        required:true
                    }
                }"></th>
                <th data-options="field:'英语',title:'英语',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html',
                        required:true
                    }
                }"></th>
                <th data-options="field:'政治',title:'政治',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html'
                    }
                }"></th>
                <th data-options="field:'历史',title:'历史',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html'
                    }
                }"></th>
                <th data-options="field:'体育',title:'体育',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html'
                    }
                }"></th>
                <th data-options="field:'物理',title:'物理',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html'
                    }
                }"></th>
                <th data-options="field:'化学',title:'化学',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html'
                    }
                }"></th>
                <th data-options="field:'地理',title:'地理',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html'
                    }
                }"></th>
                <th data-options="field:'生物',title:'生物',width:20,editor:{
                    type:'combobox',
                    options:{
                        valueField:'text',
                        textField:'text',
                        method:'get',
                        url: '/compent/Util/teacherList.html'
                    }
                }"></th>
            </tr>
        </thead>
    </table>
    <div id="uploadBox" style="display: none;height: auto;">
        <div class="m30">
            <form method="post" enctype="multipart/form-data" id="subject_teacherUploadForm" action="">
                <div class="mt20">
                    <input class="easyui-filebox" data-options="buttonText:'选择文件'" id="files" name="files" style="width:250px;">
                </div>
            </form>
        </div>
        <div class="tnc m20">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="uploadCommit('subject_teacher')" style="width: 200px;">上传</a>
        </div>
    </div>
    <script type="text/javascript">
        var url = "/examScore/subject_teacher";
        $(function(){
            initDatagridAdmin("subject_teacher", url, 0, 1, 1, 1,1);
            initGrade("subject_teacher");
        })
        function importExcel(cf) {
            $('#uploadBox').dialog({
                title : '科任教师导入',
                modal : true,
                width : 400,
                top : 100,
                buttons : '#btns'
            }).show();
        }
        function uploadCommit(cf){
            // $.messager.progress({
            //     title : '提示',
            //     msg : '上传中，请稍候...'
            // });
            $('#subject_teacherUploadForm').form('submit',{
                url: url + "/importExcel.html",
                success:function(data){
                $.messager.progress('close');
                if(data == '000') {
                    $.messager.show({title:'操作提示', msg:"上传成功"});
                    $('#uploadBox').dialog("close");
                    searchForm('subject_teacher');
                    return;
                }
                $.messager.alert('提示', data);
            }})
        }
        function downloadTemplate(name){
            window.location.href = "__STATIC__/template/" + name;
        }
    </script>
</body>
</html>